import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Silkbag from '@/components/Silkbag'
import Life from '@/components/Life'
import User from '@/components/User'
import Timenotes from '@/components/Timenotes'
import Detail from '@/components/Detail'
import Register from '@/components/Register'
import Login from '@/components/Login'
import News from '@/components/News'
import Dcim from '@/components/time/Dcim'
import Growth from '@/components/time/Growth'
import Achieve from '@/components/time/Achieve'
import RecordList from '@/components/growth/RecordList'
import Height from '@/components/growth/Height'
import Weight from '@/components/growth/Weight'
import HeadSize from '@/components/growth/HeadSize'
import Food from '@/components/silkbag/Food'
import Baike from '@/components/silkbag/Baike'
import Foodyysp from '@/components/silkbag/Foodyysp'
import Nbnc from '@/components/silkbag/Nbnc'
import Wdsc from '@/components/silkbag/Wdsc'
import Question from '@/components/silkbag/Question'
import Gz from '@/components/life/Gz'
import Up from '@/components/life/Up'
import Hui from '@/components/user/Hui'
import Ding from '@/components/user/Ding'
import Gou from '@/components/user/Gou'
import Shou from '@/components/user/Shou'
import Xiang from '@/components/user/Xiang'
import You from '@/components/user/You'
import Dais from '@/components/user/Dais'
import Details from '@/components/user/Details'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/register',
      name: 'HelloWorld',
      component: HelloWorld,
      children:[
        {
          path: '/silkbag',
          component: Silkbag
        },
        
        // 生活
        {
          path: '/life',  
          component: Life,
          children: [
            {
              path: '',
              redirect: 'noKeep'
            },
            {
              path: 'noKeep',
              component: () => import('@/components/life/NoKeep')
            },
            {
              path: 'keep',
              component: () => import('@/components/life/Keep')
            }
          ]
        },
        {
          path: '/community',
          components: {
            default: () => import('@/components/life/Community')
          },
          children: [
            {
              path: '',
              redirect: 'date1'
            },
            {
              path: 'date1',
              component: () => import('@/components/life/date1')
            },
            {
              path: 'date2',
              component: () => import('@/components/life/date2')
            },
            {
              path: 'date3',
              component: () => import('@/components/life/date3')
            },
            {
              path: 'date4',
              component: () => import('@/components/life/date4')
            },
            {
              path: 'date5',
              component: () => import('@/components/life/date5')
            }
          ]
        },
        {
          path: '/user',
          component: User
        },
        {
          path: '/timenotes',
          component: Timenotes
        },
        {
          path: '/user',
          component: User
        },
        {
          path: '/news',
          component: News
        },
      ]
    },
    {
      path: '/detail/:id',
      component: Detail
    },
    {
      path: '/register',
      component: Register
    },
    {
      path: '/dais',
      component: Dais
    },
    
    {
      path: '/hui',
      component: Hui
    },
    {
      path: '/ding',
      component: Ding
    },
    
    {
      path: '/gou',
      component: Gou
    },
    {
      path: '/shou',
      component: Shou
    },
    {
      path: '/you',
      component: You
    },
    {
      path: '/xiang',
      component: Xiang
    },
    
    {
      path: '/login',
      component: Login
    },
    {
      path: '/dcim',
      component:Dcim
    },
    {
      path: '/growth',
      component:Growth,
      redirect:'/recordList',
      name: 'Growth',
      children: [
        {
          path: '/recordList',
          component: RecordList
        },
        {
          path: '/height',
          component: Height
        },
        {
          path: '/weight',
          component: Weight
        },
        {
          path: '/headSize',
          component: HeadSize
        }
      ]
    },
    {
      path: '/achieve',
      component:Achieve
    },
    {
      path: '/details/:id',
      component:Details
    },
    {
      path: '/food',
      component: Food
    },
    {
      path: '/baike',
      component: Baike
    },
    {
      path: '/question',
      component: Question
    },
    {
      path: '/gz',
      component: Gz
    },
    {
      path: '/foodyysp',
      component: Foodyysp
    },
    {
      path: '/nbnc',
      component: Nbnc
    },
    {
      path: '/wdsc',
      component: Wdsc
    },
    {
      path: '/up',
      component: Up
    },
    {
      path: '/carts',
      name: 'carts',
      components: {
        default: () => import('@/components/user/Carts')
      }
    },
    {
      path: '/collect',
      name: 'collect',
      components: {
        default: () => import('@/components/user/Collect')
      }
    },
    {
      path: '/conpon',
      name: 'conpon',
      components: {
        default: () => import('@/components/user/Conpon')
      }
    },
    {
      path: '/indent',
      name: 'indent',
      components: {
        default: () => import('@/components/user/Indent')
      }
    },
    {
      path: '/makePhoto',
      name: 'makePhoto',
      components: {
        default: () => import('@/components/user/MakePhoto')
      }
    },
    {
      path: '/member',
      name: 'member',
      components: {
        default: () => import('@/components/user/Member')
      }
    },
  ]
})
